package com.modular.event.opt;

import cn.hutool.db.Entity;
import com.c.opt.ComOpt;
import com.modular.event.AlarmEventApi;
import com.modular.event.FactoryEventOpt;
import com.modular.event.bean.AlarmRecordsDO;
import com.modular.event.bean.AlarmRecordsOptDO;
import com.modular.extra.ai.FactoryAiOpt;

/**
 * @author: liuwenju
 * @date: 2023/6/5 13:28
 * @version: 1.0
 */
public class OptAlarmRecordsOpt extends ComOpt<AlarmRecordsOptDO> {

    public OptAlarmRecordsOpt() {
        super("alarm_records_opt");
    }

    @Override
    public String syncBean(AlarmRecordsOptDO alarmRecordsOptDO) {
        // 更新事件状态
        if ("1".equals(alarmRecordsOptDO.getType())) {
            FactoryEventOpt.RECORDS.updateFinal(alarmRecordsOptDO.getAlarmRecordsId());
        }
        return super.syncBean(alarmRecordsOptDO);
    }
}
